package com.tim.proxy;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MethodPerformance {

	private static final Log log = LogFactory.getLog(MethodPerformance.class);

	private long begin;
	private long end;
	private String serviceMethod;// 执行的方法

	public MethodPerformance(String serviceMethod) {
		this.serviceMethod = serviceMethod;
		this.begin = System.currentTimeMillis();
	}

	public void printPerformance() {
		this.end = System.currentTimeMillis();
		log.info(serviceMethod + " processing take " + (end - begin)
				+ " millisecond.");// 方法执行的耗时
	}
}
